<?php $this->pageTitle = "Заказы" ?>
<?php $baseUrl = Yii::app()->request->baseUrl ?>

<div class="container">
<style>
	#logo {
		display: block;
		height: 67px;
		margin-top: 10px;
	}
</style>

	<div class="pull-left" style="padding-right: 30px;">
		<h5>Получатель</h5>
		<strong>Имя: </strong> <?= $order->name ?> <br>
		<strong>Адрес: </strong> <?= $order->address ?> <br>
		<strong>Телефон: </strong> <?= $order->phone ?> <br>

			<strong>Доставить: </strong> <?= $order->date_delivery ?>
			<br>

		<br> <br>
	</div>
	<div class="pull-left" style="padding-right: 30px;">
		<h5>Поставщик</h5>
		<strong>Компания: </strong> <?=$order->idRestaurant->name?> <br>
		<strong>Адрес: </strong> <?= $order->idRestaurant->address ?> <br>
		<strong>Телефон: </strong> <?= $order->idRestaurant->phone ?> <br>
	</div>
	<div class="pull-right">
		<img id="logo" src="<?=Yii::app()->request->hostInfo?>/img/Universal.png">
	</div>
	<div class="pull-right" style="padding-right: 20px;margin-top: 10px;">
			<?=Settings::get('info')->value?>
	</div>

<!--	 <a id="logo" href="/"></a>-->


	<br> <br>
	<div class="clearfix"></div>
	<div>
		<h4><b>Счет к заказу №<?= $order->id?> от <?=Yii::app()->dateFormatter->format('d MMMM yyyy г.', $order->date_order)?></b></b></h4>
	</div>

	<table class="table" style="margin-top: 20px">
		<thead>
		<td style="text-align: center">№</td>
		<td>Наименование</td>
		<td style="text-align: center">Цена</td>
		<td style="text-align: center">Кол-во, шт</td>
		<td style="text-align: right">Сумма, тг</td>
		</thead>

		<? $total = 1; ?>

		<? foreach ($order->ordersItems as $item): ?>
			<tr>
				<td style="text-align: center"><?= $total ?></td>
				<td><?= $item->idFood->title ?> </td>
				<td style="text-align: center"><?= $item->price ?> </td>
				<td style="text-align: center"><?= $item->count ?> </td>
				<td style="text-align: right"><?= $item->count *  $item->price  ?> </td>
			</tr>
		<?
			$total++;
		endforeach ?>
		<tr>
			<td></td>
			<td></td>
			<td></td>
			<td style="text-align: right;"><strong>Стоимость товаров</strong></td>
			<td style="text-align: right"><?= $order->full_price ?></td>
		</tr>
		<tr>
			<td></td>
			<td></td>
			<td></td>
			<td style="text-align: right;"><strong>Стоимость доставки</strong></td>
			<td style="text-align: right"><?= $order->delivery_price ?></td>
		</tr>
		<tr>
			<td></td>
			<td></td>
			<td></td>
			<td style="text-align: right;"><strong>Итого к оплате </strong></td>
			<td style="text-align: right"><strong><?= $order->full_price+$order->delivery_price ?></strong></td>
		</tr>
	</table>
</div>